<div class="panel panel-default panel-intro">
    <div class="panel-heading">
        <h3 class="panel-title">设备详情</h3>
    </div>
    <div class="panel-body">
        <div class="row">
            <div class="col-md-6">
                <table class="table table-bordered">
                    <tr>
                        <th width="120">设备编码</th>
                        <td>{$row.equipment_code}</td>
                    </tr>
                    <tr>
                        <th>设备名称</th>
                        <td>{$row.equipment_name}</td>
                    </tr>
                    <tr>
                        <th>设备分类</th>
                        <td>{$row.category.name}</td>
                    </tr>
                    <tr>
                        <th>设备类型</th>
                        <td>
                            {if $row.type == 'production'}
                                生产设备
                            {elseif $row.type == 'auxiliary'}
                                辅助设备
                            {elseif $row.type == 'testing'}
                                检测设备
                            {elseif $row.type == 'transport'}
                                运输设备
                            {/if}
                        </td>
                    </tr>
                    <tr>
                        <th>规格型号</th>
                        <td>{$row.specification}</td>
                    </tr>
                </table>
            </div>
            <div class="col-md-6">
                <table class="table table-bordered">
                    <tr>
                        <th width="120">设备状态</th>
                        <td>
                            {if $row.status == 'normal'}
                                <span class="label label-success">正常</span>
                            {elseif $row.status == 'maintenance'}
                                <span class="label label-warning">维护中</span>
                            {elseif $row.status == 'fault'}
                                <span class="label label-danger">故障</span>
                            {elseif $row.status == 'idle'}
                                <span class="label label-info">闲置</span>
                            {/if}
                        </td>
                    </tr>
                    <tr>
                        <th>生产厂家</th>
                        <td>{$row.manufacturer}</td>
                    </tr>
                    <tr>
                        <th>购买日期</th>
                        <td>{$row.purchase_date}</td>
                    </tr>
                    <tr>
                        <th>使用率</th>
                        <td>{$row.usage_rate}%</td>
                    </tr>
                    <tr>
                        <th>创建时间</th>
                        <td>{$row.createtime|datetime}</td>
                    </tr>
                </table>
            </div>
        </div>
        
        {if $row.remark}
        <div class="row">
            <div class="col-md-12">
                <h4>备注</h4>
                <p>{$row.remark}</p>
            </div>
        </div>
        {/if}
        
        <!-- 维护记录 -->
        <div class="row">
            <div class="col-md-12">
                <h4>维护记录</h4>
                <table class="table table-striped">
                    <thead>
                        <tr>
                            <th>维护时间</th>
                            <th>维护类型</th>
                            <th>维护内容</th>
                            <th>维护结果</th>
                            <th>操作员</th>
                        </tr>
                    </thead>
                    <tbody>
                        {foreach $maintenanceList as $maintenance}
                        <tr>
                            <td>{$maintenance.createtime|datetime}</td>
                            <td>
                                {if $maintenance.maintenance_type == 'preventive'}
                                    预防性维护
                                {elseif $maintenance.maintenance_type == 'repair'}
                                    维修
                                {elseif $maintenance.maintenance_type == 'inspection'}
                                    检查
                                {elseif $maintenance.maintenance_type == 'status_change'}
                                    状态变更
                                {/if}
                            </td>
                            <td>{$maintenance.maintenance_content}</td>
                            <td>{$maintenance.maintenance_result}</td>
                            <td>{$maintenance.operator.username}</td>
                        </tr>
                        {/foreach}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
